#ifndef _CDESKTOP_H_
#define _CDESKTOP_H_

#include "auto.h"
#include <buola/fsgui/cfilelist.h>

namespace buola { namespace bdesktop {

struct SWallpaper
{
    CURL mURL;
    int mMode;
};

class CDesktop : public CFileList
{
public:
    CDesktop();
    ~CDesktop();
    
protected:
    void SetNextBack();
    void SetRandomBack();

////////////// event handling //////////////
    virtual void OnCreate();
    virtual void OnFillMenu(gui::PMenu pMenu,bool pItem);
    void OnTerm();
    void OnLaunchWM();
    void OnSettings();
    virtual void OnExpose(gui::CExposeEvent*);
    void OnTimer();
    virtual void OnIntAction(CFileInterface::EIntAction pAction,const CURL &pURL);
    
protected:
    std::vector<std::unique_ptr<SWallpaper>> mWallpapers;
    int mCurrent;
    PImage mCurrentImage;

    CBgDialog *mBgDialog;
    CTimer *mTimer;

    CSize mScreenSize;

    friend class CBgDialog;
};

/*namespace bdesktop*/ } /*namespace buola*/ }

#endif
